package modelo.reglas.composite;

import modelo.reglas.CompositeSpecification;
import modelo.reglas.ISpecification;
import modelo.reglas.Specificable;

public class AndSpecification<T extends Specificable> extends
		CompositeSpecification<T> {
	private ISpecification<T> one;
	private ISpecification<T> other;

	public AndSpecification(ISpecification<T> x, ISpecification<T> y) {
		one = x;
		other = y;
	}

	public Boolean isSatisfiedBy(T candidate) {
		return one.isSatisfiedBy(candidate) && other.isSatisfiedBy(candidate);
	}
}
